<template>
	<div class="view-point">
		<van-nav-bar title="我的积分" left-arrow @click-left="$router.go(-1)" />
		<div class="point-list">
			<div class="point-item" v-for="(item,index) in pointList" :key="index">
				<div class="item_hd">
					<div class="time">{{item.createTime}}</div>
					<div class="value">+{{item.value}}</div>
					<div class="description">{{item.description}}</div>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
	import userApi from "@/api/user"
	export default {
		data() {
			return {
				pointList: []
			}
		},
		methods: {
			getPointList() {
				userApi.getPointList().then(res => {
					this.pointList = res.list;
					console.log(this.pointList);
				})
			},
			initPage() {
				this.getPointList()
			},
		},
		created() {
			this.initPage();
		}
	}
</script>
<style lang="less" scoped>
	.point-list {
		padding: 5px 10px;

		.item_hd {
			background-color: #fff;
			padding: 5px 10px;
			margin-bottom: 10px;
			border-radius: 5px;
			text-align:left;
			.time {
				font-weight: 700;
				font-size: 14px;
			}

			.value {
				float: right;
				color: #f44;
				margin-top:-15px;
			}

		}
	}
</style>
